package com.inspur.edp.team.manager;

import com.inspur.edp.team.dao.PaasTeamDao;
import com.inspur.edp.team.dao.PaasTeamMemberDao;
import com.inspur.edp.team.domain.PaasTeam;
import com.inspur.edp.team.domain.PaasTeamMember;
import io.iec.edp.caf.commons.utils.SpringBeanUtils;

import javax.transaction.Transactional;

public class PaasTeamManager {
    private PaasTeamDao paasTeamDao = SpringBeanUtils.getBean(PaasTeamDao.class);
    private PaasTeamMemberDao paasTeamMemberDao = SpringBeanUtils.getBean(PaasTeamMemberDao.class);


    /**
     * 保存团队、团队成员信息
     *
     * @param paasTeam
     * @param paasTeamMember
     */
    @Transactional
    public String saveTeamAndTeamMember(PaasTeam paasTeam, PaasTeamMember paasTeamMember) {
        PaasTeam result = paasTeamDao.save(paasTeam);
        paasTeamMemberDao.save(paasTeamMember);
        return result.getId();
    }

}
